﻿namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [Serializable]
    public class CloseExcelNParam : BaseParam {
        //0关闭指定excel，1关闭全部excel
        private int closeOper = 0;
        private string closeObjName = "{excelObject}";
        //关闭前操作0保存，1另存为，2不保存
        private int beforeClose = 0;
        private string saveAsPath = "";
        private bool coverIfExist = false;

        public bool CoverIfExist {
            get => coverIfExist;
            set {
                coverIfExist = value;
                NotifyPropertyChanged("CoverIfExist");
            }
        }
        public int CloseOper {
            get => closeOper;
            set {
                closeOper = value;
                NotifyPropertyChanged("CloseOper");
            }
        }
        public string CloseObjName {
            get => closeObjName;
            set {
                closeObjName = value;
                NotifyPropertyChanged("CloseObjName");
            }
        }
        public string SaveAsPath {
            get => saveAsPath;
            set {
                saveAsPath = value;
                NotifyPropertyChanged("SaveAsPath");
            }
        }
        public int BeforeClose {
            get => beforeClose;
            set {
                beforeClose = value;
                NotifyPropertyChanged("BeforeClose");
            }
        }

        public string GetTranslateCloseOper() {
            switch(this.closeOper) {
                case 0:
                    return "关闭指定Excel";
                case 1:
                    return "关闭全部Excel";
                default:
                    return "关闭指定Excel";
            }
        }


        public string GetTranslateBeforeClose() {
            switch(this.BeforeClose) {
                case 0:
                    return "保存";
                case 1:
                    return "另存为";
                case 2:
                    return "不保存";
                default:
                    return "保存";
            }
        }
    }
}
